package com.dragon.modules.yuegou.query.merchant;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.merchant.QrcodeEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 商户二维码 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-09-28 14:32:38
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class QrcodeQuery extends QrcodeEntity implements Query<QrcodeEntity> {

    /** 商户ID查询条件 */
	@JsonUnwrapped(prefix = "merchantId")
	private Condition<String> merchantIdCondition;

    /** 二维码地址查询条件 */
	@JsonUnwrapped(prefix = "qrcodeUrl")
	private Condition<String> qrcodeUrlCondition;

    /** 链接地址查询条件 */
	@JsonUnwrapped(prefix = "link")
	private Condition<String> linkCondition;

    /** 短链接查询条件 */
	@JsonUnwrapped(prefix = "shortUrl")
	private Condition<String> shortUrlCondition;

    /** 折扣 0.01到100.00的浮点数，填写90.00表示打9折系统默认是100.00查询条件 */
	@JsonUnwrapped(prefix = "discount")
	private Condition<BigDecimal> discountCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 状态:0 关闭　1:开启查询条件 */
	@JsonUnwrapped(prefix = "status")
	private Condition<Boolean> statusCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public QrcodeQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public QrcodeQuery(QrcodeEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public QrcodeQuery(QrcodeQuery other) {
		super(other);
		if(other.merchantIdCondition != null) {
			this.merchantIdCondition = other.merchantIdCondition.copy();
		}
		if(other.qrcodeUrlCondition != null) {
			this.qrcodeUrlCondition = other.qrcodeUrlCondition.copy();
		}
		if(other.linkCondition != null) {
			this.linkCondition = other.linkCondition.copy();
		}
		if(other.shortUrlCondition != null) {
			this.shortUrlCondition = other.shortUrlCondition.copy();
		}
		if(other.discountCondition != null) {
			this.discountCondition = other.discountCondition.copy();
		}
		if(other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		if(other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if(other.statusCondition != null) {
			this.statusCondition = other.statusCondition.copy();
		}
	}

	@Override
	public QueryWrapper<QrcodeEntity> toQueryWrapper() {
		QueryWrapper<QrcodeEntity> wrapper = new QueryWrapper<>(this);
		if (merchantIdCondition != null) {
			merchantIdCondition.toWrapper(wrapper, COL_MERCHANT_ID);
		}
		if (qrcodeUrlCondition != null) {
			qrcodeUrlCondition.toWrapper(wrapper, COL_QRCODE_URL);
		}
		if (linkCondition != null) {
			linkCondition.toWrapper(wrapper, COL_LINK);
		}
		if (shortUrlCondition != null) {
			shortUrlCondition.toWrapper(wrapper, COL_SHORT_URL);
		}
		if (discountCondition != null) {
			discountCondition.toWrapper(wrapper, COL_DISCOUNT);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (statusCondition != null) {
			statusCondition.toWrapper(wrapper, COL_STATUS);
		}
		return wrapper;
	}

	/**
	 * 构造并返回商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> merchantId() {
		this.merchantIdCondition = new Condition<>();
		return this.merchantIdCondition;
	}
	
	/**
	 * 获取商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> getMerchantIdCondition() {
		return merchantIdCondition;
	}

	/**
	 * 设置商户ID查询条件
	 * 
	 * @param merchantIdCondition 商户ID查询条件
	 */
	public void setMerchantIdCondition(Condition<String> merchantIdCondition) {
		this.merchantIdCondition = merchantIdCondition;
	}

	/**
	 * 构造并返回二维码地址查询条件
	 * 
	 * @return qrcodeUrlCondition 二维码地址查询条件
	 */
	public Condition<String> qrcodeUrl() {
		this.qrcodeUrlCondition = new Condition<>();
		return this.qrcodeUrlCondition;
	}
	
	/**
	 * 获取二维码地址查询条件
	 * 
	 * @return qrcodeUrlCondition 二维码地址查询条件
	 */
	public Condition<String> getQrcodeUrlCondition() {
		return qrcodeUrlCondition;
	}

	/**
	 * 设置二维码地址查询条件
	 * 
	 * @param qrcodeUrlCondition 二维码地址查询条件
	 */
	public void setQrcodeUrlCondition(Condition<String> qrcodeUrlCondition) {
		this.qrcodeUrlCondition = qrcodeUrlCondition;
	}

	/**
	 * 构造并返回链接地址查询条件
	 * 
	 * @return linkCondition 链接地址查询条件
	 */
	public Condition<String> link() {
		this.linkCondition = new Condition<>();
		return this.linkCondition;
	}
	
	/**
	 * 获取链接地址查询条件
	 * 
	 * @return linkCondition 链接地址查询条件
	 */
	public Condition<String> getLinkCondition() {
		return linkCondition;
	}

	/**
	 * 设置链接地址查询条件
	 * 
	 * @param linkCondition 链接地址查询条件
	 */
	public void setLinkCondition(Condition<String> linkCondition) {
		this.linkCondition = linkCondition;
	}

	/**
	 * 构造并返回短链接查询条件
	 * 
	 * @return shortUrlCondition 短链接查询条件
	 */
	public Condition<String> shortUrl() {
		this.shortUrlCondition = new Condition<>();
		return this.shortUrlCondition;
	}
	
	/**
	 * 获取短链接查询条件
	 * 
	 * @return shortUrlCondition 短链接查询条件
	 */
	public Condition<String> getShortUrlCondition() {
		return shortUrlCondition;
	}

	/**
	 * 设置短链接查询条件
	 * 
	 * @param shortUrlCondition 短链接查询条件
	 */
	public void setShortUrlCondition(Condition<String> shortUrlCondition) {
		this.shortUrlCondition = shortUrlCondition;
	}

	/**
	 * 构造并返回折扣 0.01到100.00的浮点数，填写90.00表示打9折系统默认是100.00查询条件
	 * 
	 * @return discountCondition 折扣 0.01到100.00的浮点数，填写90.00表示打9折系统默认是100.00查询条件
	 */
	public Condition<BigDecimal> discount() {
		this.discountCondition = new Condition<>();
		return this.discountCondition;
	}
	
	/**
	 * 获取折扣 0.01到100.00的浮点数，填写90.00表示打9折系统默认是100.00查询条件
	 * 
	 * @return discountCondition 折扣 0.01到100.00的浮点数，填写90.00表示打9折系统默认是100.00查询条件
	 */
	public Condition<BigDecimal> getDiscountCondition() {
		return discountCondition;
	}

	/**
	 * 设置折扣 0.01到100.00的浮点数，填写90.00表示打9折系统默认是100.00查询条件
	 * 
	 * @param discountCondition 折扣 0.01到100.00的浮点数，填写90.00表示打9折系统默认是100.00查询条件
	 */
	public void setDiscountCondition(Condition<BigDecimal> discountCondition) {
		this.discountCondition = discountCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdByCondition 查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdByCondition 查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return createdTimeCondition 查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param createdTimeCondition 查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回状态:0 关闭　1:开启查询条件
	 * 
	 * @return statusCondition 状态:0 关闭　1:开启查询条件
	 */
	public Condition<Boolean> status() {
		this.statusCondition = new Condition<>();
		return this.statusCondition;
	}
	
	/**
	 * 获取状态:0 关闭　1:开启查询条件
	 * 
	 * @return statusCondition 状态:0 关闭　1:开启查询条件
	 */
	public Condition<Boolean> getStatusCondition() {
		return statusCondition;
	}

	/**
	 * 设置状态:0 关闭　1:开启查询条件
	 * 
	 * @param statusCondition 状态:0 关闭　1:开启查询条件
	 */
	public void setStatusCondition(Condition<Boolean> statusCondition) {
		this.statusCondition = statusCondition;
	}

}
